﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceDog.UpdateDB.Model.Data
{
    public class DbInitializer
    {
        public static void Initialize(EFContext context)
        {
            if (context.Users.Any())
            {
                return;
            }
            var ran = new Random();
            for (int i = 1; i <= 100; i++)
            {
                context.Users.Add(new UserModel()
                {
                    Name=$"user{i}",
                    Age=ran.Next(10,50),
                    Remark="test user",
                    Email="123456@qq.com",
                    Country="China",
                });
            }
            context.SaveChanges();
        }
    }
}
